{extend name="base" /}
<!-- page specific plugin styles -->
{block name="inline-styles"}
{/block}
<!-- PAGE CONTENT BEGINS -->
{block name="content"}
<div class="page js_show">
    <div class="page__bd">

        <form class="weui-wepay-pay" id="ajaxForm">

                <div class="weui-cells">
                    <a class="weui-cell weui-cell_access" href="{:url('Index/bankcard')}">
                        <div class="weui-cell__hd">
                            <label class="weui-label">到账账户</label>
                        </div>
                        <div class="weui-cell__bd">
                            <h4 class="weui-media-box__title">{$payment.paytype_name}</h4>
                            <p class="weui-media-box__desc">{$payment.num}</p>
                            <input type="hidden" name="bank_id" value='{$payment.id}'>
                        </div>
                        <span class="weui-cell__ft"></span>
                    </a>
                </div>
            <div class="weui-wepay-pay__bd">
                <div class="weui-wepay-pay__inner">
                    <h1 class="weui-wepay-pay__title">提现虚拟币(元)</h1>
                    <div class="weui-wepay-pay__inputs"> <strong class="weui-wepay-pay__strong">￥</strong>
                        <input type="number" name="money" class="weui-wepay-pay__input" placeholder="请输入金额"></div>
                    <div class="weui-wepay-pay__intro">可提现金额：￥{$rewardaccount} <br>（充值金额不可提现，只可用于购买商品）</div>
                </div>

            </div>
            <div class="weui-wepay-pay__ft">
                <!-- <p class="weui-wepay-pay__info">支付金额给商户</p> -->
                <div class="weui-wepay-pay__btn">
                    <a href="javascript:;" class="weui-btn weui-btn_primary" id="showToast">提交申请</a>
                </div>
            </div>
        </form>
    
    </div>
    <div class="page__ft">
        <div class="weui-footer weui-footer_fixed-bottom">
            <p class="weui-footer__links">
                <a href="javascript:void(0);" class="weui-footer__link">米粒生活</a>
            </p>
            <p class="weui-footer__text">Copyright © 2008-2018 mlilife.com</p>
        </div>
    </div>
</div>
{/block}
<!-- PAGE CONTENT ENDS -->
<!-- inline scripts related to this page -->
{block name="related-scripts"}
<script type="text/javascript">
    $("#showToast").click(function(event) {
        /* Act on the event */
        var options={
            url:"/api/v1/member/withdraw",
            type:"POST",
            dataType:"json",
            success: function(json){

                if(json.returnCode==1){
                    $.toast("提交成功", function() {
                        window.location.href = "{:url('Index/withdraw_list')}";
                    });
                }else{
                    $.toptip(json.returnMsg, 'error');
                }
            }
        };
        $("#ajaxForm").ajaxSubmit(options)
    });

//重置浏览器回退链接
browserBack("assets.html");
</script>
{/block}